worker_processes auto;

events {
    worker_connections 1024;
}

http {
    upstream flask_servers {
        server flask1:5000;
        server flask2:5000;
        server flask3:5000;
    }

    server {
        listen 443 ssl;
        listen [::]:443 ssl;

        server_name your_domain.com;

        ssl_certificate /path/to/your/certificate.crt;
        ssl_certificate_key /path/to/your/privatekey.key;

        location / {
            proxy_pass https://flask_servers;
        }
    }
}
